/**
 * Created by HFY on 2017/4/24.
 */
var firmNameHeightS = $(window).height()-$(".information_center").offset().top;
var firmNameWidht = $(window).width();
//动态给文件夹设置高度
$(".information_bottom").css({
    "height":firmNameHeightS-30,
    "widht":firmNameWidht
});
var titleNameWidth = $(".information_center").width()-120;
$(".information_name").css({
    "width":titleNameWidth
})
$(window).resize(function(){
    var firmNameHeightS = $(window).height()-$(".information_bottom").offset().top;
    //动态给文件夹设置高度
    $(".information_bottom").css({
        "height":firmNameHeightS-30,
        "width":firmNameWidht
    });
    //动态设置标题width
    var titleNameWidth = $(".information_center").width()-120;
    $(".information_name").css({
        "width":titleNameWidth
    })
});
//新版本
$(".information_new_a").click(function () {
    $(".new_release").show();
    $(".dz-default span").text("拖拽文件或点击这里上传！");
});
$(".uploading_to_top_cancel").click(function () {
    $(".new_release").hide();
    //刷新页面
    location.reload();
});
//点击下拉
var informationHide = $(".information_hide");
$(".information_span01").click(function () {
    informationHide.slideToggle()
});
//移动
$(".information_move").click(function () {
    $(".move_to").show();
});
$(".move_to_top_cancel").click(function () {
    $(".move_to").hide();
});
$(".move_to_cancel").click(function () {
    $(".move_to").hide();
});
//复制
$(".information_copy").click(function () {
    $(".copy_to").show();
});
$(".copy_to_top_cancel").click(function () {
    $(".copy_to").hide();
});
$(".copy_to_cancel").click(function () {
    $(".copy_to").hide();
});
//删除
$(".information_remove").click(function () {
    $(".confirm_delete").show();
});
$(".confirm_delete_a1").click(function () {
    $(".confirm_delete").hide();
});
//移动至-高亮显示
var moveToUlLi = $(".move_to_ul li");
for (var i = 0; i < moveToUlLi.length; i++) {
    moveToUlLi[i].onclick = function () {
        for (var j = 0; j < moveToUlLi.length; j++) {
            moveToUlLi[j].className = "";
        }
        this.className = "move_bac_click ";
    }
}
var copyToUlLi = $(".copy_to_ul li");
for (var i = 0; i < copyToUlLi.length; i++) {
    copyToUlLi[i].onclick = function () {
        for (var j = 0; j < copyToUlLi.length; j++) {
            copyToUlLi[j].className = "";
        }
        this.className = "move_bac_click ";
    }
}
//鼠标移入显示详细信息
var firmNameSpan = $(".information_name");
for (var i = 0; i < firmNameSpan.length; i++) {
    firmNameSpan[i].onmouseenter = function () {
        firmNameSpan.attr("title",$(this).text());
    }
}
//关闭错误提醒
$(".alert_warning_a").click(function() {
    $(".alert-warning").slideUp();
});
$(".information_ul li").click(function() {
    $(this).addClass("information_li_add") ;
});
//图标ioc
function iocn(){
    var liImgArray = $(".information_title_left img");
    var liImgText = $(".information_title_left span").text();
    //['png','jpg','ai','asp','avi','bmp','css','doc','dwg','email','excel','flash','html','id','java','json','mp3','mp4','other','pdf','ppt','ps','rar','swf','text','url','wav','wma','wmv','wps','zip']
    var path = ["/static/images/icon/icon_small/png01.png","/static/images/icon/icon_small/jpeg01.png","/static/images/icon/icon_small/gif01.png","/static/images/icon/icon_small/ai01.png","/static/images/icon/icon_small/asp01.png","/static/images/icon/icon_small/avi01.png","/static/images/icon/icon_small/bmp01.png","/static/images/icon/icon_small/css01.png","/static/images/icon/icon_small/doc01.png","/static/images/icon/icon_small/dwg01.png","/static/images/icon/icon_small/email01.png","/static/images/icon/icon_small/excel01.png","/static/images/icon/icon_small/flash01.png","/static/images/icon/icon_small/html01.png","/static/images/icon/icon_small/id01.png","/static/images/icon/icon_small/java01.png","/static/images/icon/icon_small/json01.png","/static/images/icon/icon_small/mp301.png","/static/images/icon/icon_small/mp401.png","/static/images/icon/icon_small/other01.png","/static/images/icon/icon_small/pdf01.png","/static/images/icon/icon_small/ppt01.png","/static/images/icon/icon_small/ps01.png","/static/images/icon/icon_small/rar01.png","/static/images/icon/icon_small/swf01.png","/static/images/icon/icon_small/text01.png","/static/images/icon/icon_small/url01.png","/static/images/icon/icon_small/wav01.png","/static/images/icon/icon_small/wma01.png","/static/images/icon/icon_small/wmv01.png","/static/images/icon/icon_small/wps01.png","/static/images/icon/icon_small/zip01.png"];
        var fileExtension = liImgText.split('.').pop().toLowerCase();
        if(fileExtension == "png") {      
            liImgArray.attr('src',path[0]);   
        }else if(fileExtension == "jpg") {    
            liImgArray.attr('src',path[1]); 
        }else if(fileExtension == "jpeg") {    
            liImgArray.attr('src',path[1]); 
        }else if(fileExtension == "gif") {         
            liImgArray.attr('src',path[2]); 
        }else if(fileExtension == "ai") {         
            liImgArray.attr('src',path[3]); 
        }else if(fileExtension == "asp") {           
            liImgArray.attr('src',path[4]); 
        }else if(fileExtension == "avi") {           
            liImgArray.attr('src',path[5]); 
        }else if(fileExtension == "bmp") {           
            liImgArray.attr('src',path[6]); 
        }else if(fileExtension == "css") {           
            liImgArray.attr('src',path[7]); 
        }else if(fileExtension == "doc") {           
            liImgArray.attr('src',path[8]); 
        }else if(fileExtension == "docx") {           
            liImgArray.attr('src',path[8]); 
        }else if(fileExtension == "dwg") {           
            liImgArray.attr('src',path[9]); 
        }else if(fileExtension == "email") {           
            liImgArray.attr('src',path[10]); 
        }else if(fileExtension == "excel") {           
            liImgArray.attr('src',path[11]); 
        }else if(fileExtension == "flash") {           
            liImgArray.attr('src',path[12]); 
        }else if(fileExtension == "html") {           
            liImgArray.attr('src',path[13]); 
        }else if(fileExtension == "id") {           
            liImgArray.attr('src',path[14]); 
        }else if(fileExtension == "java") {           
            liImgArray.attr('src',path[15]); 
        }else if(fileExtension == "json") {           
            liImgArray.attr('src',path[16]); 
        }else if(fileExtension == "mp3") {           
            liImgArray.attr('src',path[17]);
        }else if(fileExtension == "mp4") {           
            liImgArray.attr('src',path[18]); 
        }else if(fileExtension == "other") {           
            // liImgArray.attr('src',path[19]); 
        }else if(fileExtension == "pdf") {           
            liImgArray.attr('src',path[20]); 
        }else if(fileExtension == "ppt") {           
            liImgArray.attr('src',path[20]); 
        }else if(fileExtension == "pptx") {           
            liImgArray.attr('src',path[21]); 
        }else if(fileExtension == "ps") {           
            liImgArray.attr('src',path[22]); 
        }else if(fileExtension == "rar") {           
            liImgArray.attr('src',path[23]); 
        }else if(fileExtension == "swf") {           
            liImgArray.attr('src',path[24]); 
        }else if(fileExtension == "txt") {           
            liImgArray.attr('src',path[25]); 
        }else if(fileExtension == "url") {           
            liImgArray.attr('src',path[26]); 
        }else if(fileExtension == "wav") {           
            liImgArray.attr('src',path[27]); 
        }else if(fileExtension == "wma") {           
            liImgArray.attr('src',path[28]); 
        }else if(fileExtension == "wmv") {           
            liImgArray.attr('src',path[29]); 
        }else if(fileExtension == "wps") {           
            liImgArray.attr('src',path[30]); 
        }else if(fileExtension == "zip") {           
            liImgArray.attr('src',path[31]); 
        }
}
$(".information_name").bind('DOMNodeInserted', function(e) {  
    iocn();
});  
$(document).ready(function(){ //兼容ie8
        var Id = setTimeout(function(){
            iocn();
        },500);
});